//
//  SettingItemModel.m
//  AutoMate
//
//  Created by hao on 2018/3/1.
//  Copyright © 2018年 songlei. All rights reserved.
//

#import "SettingItemModel.h"

@implementation SettingItemModel

/**
 标题->箭头(其它样式)
 都可为空
 @param title             标题
 @param titleColor        标题颜色
 @param type              右边view的类型
 @param rightViewBlock    右边view点击的回调
 @param controller        cell点击跳转的控制器(如果与cellOptionBlock回调同时设置，都会执行)
 @return SettingItem模型
 */
+ (instancetype)settingItemDataWithTitle:(NSString *)title
                              titleColor:(UIColor *)titleColor
                                    type:(CellRightViewType)type
                          rightViewBlock:(CellRightViewClickBlock)rightViewBlock
                              controller:(Class)controller
{
    SettingItemModel *itemModel = [self settingItemDataWithTitle:title titleColor:titleColor detailTitle:nil detailTitleColor:nil type:type controller:controller];
    itemModel.rightViewClickBlock = rightViewBlock;
    return itemModel;
}

/**
 标题->详情图片->箭头(其它样式)
 都可为空
 @param title             标题
 @param titleColor        标题颜色
 @param detailImage       详情图片
 @param detailSelectImage 详情选中图片
 @param type              右边view的类型
 
 @return SettingItem模型
 */
+ (instancetype)settingItemDataWitTitle:(NSString *)title
                             titleColor:(UIColor *)titleColor
                            detailImage:(UIImage *)detailImage
                      detailSelectImage:(UIImage *)detailSelectImage
                                   type:(CellRightViewType)type
                             controller:(Class)controller
{
    SettingItemModel *itemModel = [self settingItemDataWithIcon:nil title:title titleColor:titleColor detailTitle:nil detailTitleColor:nil type:type rightViewBlock:nil cellOptionBlock:nil controller:controller];
    itemModel.detailImage = detailImage;
    itemModel.detailSelectImage = detailSelectImage;
    return itemModel;
}

/**
 标题图->标题->箭头(其它样式)
 都可为空
 @param icon             标题图
 @param title            标题
 @param titleColor       标题颜色
 @param type             右边view的类型
 @param rightViewBlock   右边view点击的回调
 @param controller       cell点击跳转的控制器(如果与cellOptionBlock回调同时设置，都会执行)
 
 @return SettingItem模型
 */
+ (instancetype)settingItemDataWithIcon:(UIImage *)icon
                                  title:(NSString *)title
                             titleColor:(UIColor *)titleColor
                                   type:(CellRightViewType)type
                         rightViewBlock:(CellRightViewClickBlock)rightViewBlock
                             controller:(Class)controller
{
    return [self settingItemDataWithIcon:icon title:title titleColor:titleColor detailTitle:nil detailTitleColor:nil type:type rightViewBlock:rightViewBlock cellOptionBlock:nil controller:controller];
}

/**
 标题->描述->箭头(其它样式)
 都可为空
 @param title            标题
 @param titleColor       标题颜色
 @param detailTitle      描述
 @param detailTitleColor 描述颜色
 @param type             右边view的类型
 @param controller       cell点击跳转的控制器(如果与cellOptionBlock回调同时设置，都会执行)
 
 @return SettingItem模型
 */
+ (instancetype)settingItemDataWithTitle:(NSString *)title
                              titleColor:(UIColor *)titleColor
                             detailTitle:(NSString *)detailTitle
                        detailTitleColor:(UIColor *)detailTitleColor
                                    type:(CellRightViewType)type
                              controller:(Class)controller
{
    return [self settingItemDataWithIcon:nil title:title titleColor:titleColor detailTitle:detailTitle detailTitleColor:detailTitleColor type:type rightViewBlock:nil cellOptionBlock:nil controller:controller];
}

/**
 标题图->标题->描述->箭头(其它样式)
 都可为空
 @param icon             标题图
 @param title            标题
 @param titleColor       标题颜色
 @param detailTitle      描述
 @param detailTitleColor 描述颜色
 @param type             右边view的类型
 @param rightViewBlock   右边view点击的回调
 @param cellOptionBlock  cell点击回调
 @param controller       cell点击跳转的控制器(如果与cellOptionBlock回调同时设置，都会执行)
 
 @return SettingItem模型
 */
+ (instancetype)settingItemDataWithIcon:(UIImage *)icon
                                  title:(NSString *)title
                             titleColor:(UIColor *)titleColor
                            detailTitle:(NSString *)detailTitle
                       detailTitleColor:(UIColor *)detailTitleColor
                                   type:(CellRightViewType)type
                         rightViewBlock:(CellRightViewClickBlock)rightViewBlock
                        cellOptionBlock:(CellOptionBlock)cellOptionBlock
                             controller:(Class)controller
{
    SettingItemModel *model = [[SettingItemModel alloc] init];
    model.icon = icon;
    model.title = title;
    model.titleColor = titleColor;
    model.detailTitle = detailTitle;
    model.detailTitleColor = detailTitleColor;
    model.rightViewType = type;
    model.rightViewClickBlock = rightViewBlock;
    model.cellOptionBlock = cellOptionBlock;
    model.targetController = controller;
    model.cellDefaultMargin = 15;
    model.rowHeight = 44.0;
    return model;
}

@end
